<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:oo="http://openfaces.org/">

    <ui:composition template="/WEB-INF/templates/principal.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListPedidoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListPedidoEmpty}" rendered="#{pedidoController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{pedidoController.items.rowCount > 0}">
                    <h:outputText value="#{pedidoController.pagination.pageFirstItem + 1}..#{pedidoController.pagination.pageLastItem + 1}/#{pedidoController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{pedidoController.previous}" value="#{bundle.Previous} #{pedidoController.pagination.pageSize}" rendered="#{pedidoController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{pedidoController.next}" value="#{bundle.Next} #{pedidoController.pagination.pageSize}" rendered="#{pedidoController.pagination.hasNextPage}"/>&nbsp;
                    <oo:dataTable value="#{pedidoController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <oo:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListPedidoTitle_id}"/>
                            </f:facet>
                            <h:outputText value="#{item.id}"/>
                        </oo:column>
                        <oo:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListPedidoTitle_fecha}"/>
                            </f:facet>
                            <h:outputText value="#{item.fecha}">
                                <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                            </h:outputText>
                        </oo:column>
                        <oo:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListPedidoTitle_total}"/>
                            </f:facet>
                            <h:outputText value="#{item.total}"/>
                        </oo:column>
                        <oo:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListPedidoTitle_estadoId}"/>
                            </f:facet>
                            <h:outputText value="#{item.estadoId}"/>
                        </oo:column>
                        <oo:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListPedidoTitle_clienteId}"/>
                            </f:facet>
                            <h:outputText value="#{item.clienteId}"/>
                        </oo:column>
                        <oo:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListPedidoTitle_borradoId}"/>
                            </f:facet>
                            <h:outputText value="#{item.borradoId}"/>
                        </oo:column>
                        <oo:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{pedidoController.prepareView}" value="#{bundle.ListPedidoViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{pedidoController.prepareEdit}" value="#{bundle.ListPedidoEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{pedidoController.destroy}" value="#{bundle.ListPedidoDestroyLink}"/>
                        </oo:column>
                    </oo:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{pedidoController.prepareCreate}" value="#{bundle.ListPedidoCreateLink}"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.ListPedidoIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
